const query = require('../extend/query')
const getUserList = async(params) => {
    console.log(params, 'params')
    let sql = `select * from name`
    let res = await query(sql)
    console.log(res, 'res')
    return res
}
const editUser = async(params) => {
    const { id, username, age } = params
    let sql = `update user set username='${username}',age=${age}`
    console.log(sql, 'sql');
    let res = await query(sql)
    console.log(res, 'res');
    // if (res.affectedRows == 1) {
    //     return {
    //         status: true,
    //         message: '修改成功',
    //     }


    // } else {
    //     return {
    //         status: false,
    //         message: "修改失败",
    //     }
    // }
}
module.exports = {
    getUserList,
    editUser,
}